package kamikaze.service.cart;

import kamikaze.ShoppingCart;
import kamikaze.support.HttpMethod;
import kamikaze.support.Service;
import kamikaze.support.ServiceConfig;
import kamikaze.support.ServiceContext;

@ServiceConfig(path = "cart/checkout", method = HttpMethod.GET)
public class CheckOutPage implements Service {

	@Override
	public String serve(ServiceContext ctx) throws Exception {

		ctx.getUserSession().ensureLoginAsUser();

		ctx.getRequest().setAttribute("cart", ShoppingCart.from(ctx));

		return "cart/checkout";
	}
}
